package com.jack006.enums;

/**
 * @Classname UserStatus
 * @Description 用户激活状态枚举
 * @Date 2021-06-14 09:42
 * @Created by jack
 */
public enum UserStatus {
    INACTIVE(0,"未激活"),
    ACTIVE(1,"激活"),
    FROZEN(2,"冻结");

    public final Integer type;
    public final String value;

    UserStatus(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    /**
     * 判断传入的用户状态是不是有效的值
     * @param tempStatus
     * @return
     */
    public static boolean isUserStatusValid(Integer tempStatus) {
        if (tempStatus != null) {
            if (tempStatus == INACTIVE.type || tempStatus == ACTIVE.type || tempStatus == FROZEN.type) {
                return true;
            }
        }
        return false;
    }
}
